<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});
//Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');

Route::group(['namespace'=>'Admin'],function(){
	Route::group(['middleware'=>'auth.admin'],function($router){
		Route::get('/','IndexController@index');
		//后台菜单
		Route::resource('menu','MenuController');
		//店铺菜单
		Route::resource('smenu','SmenuController');
		//后台用户
		Route::resource('admin','AdminController');
		//后台店铺
		Route::resource('shop','ShopController');
		//店铺成员
        Route::resource('shopmaster','ShopMasterController');
        Route::get('show_shopmaster/{hmid}','ShopMasterController@show_shopmaster');
		//套餐说明
		Route::resource('sclass','SclassController');
		//普通会员信息
		Route::resource('userinfo','UserInfoController');
		//hairstyle
		Route::resource('hair','HairController');
		Route::post('hair_status','HairController@hair_status');
		//haircolor
		Route::resource('haircolor','HairColorController');
		//hair_color
		Route::resource('color','ColorController');
		//店铺活动
        Route::resource('activity','ActivityController');
        //分类列表
        Route::resource('type','TypeController');
        //公司文章
        Route::resource('article','ArticleController');
        //这是店铺文章
        Route::resource('shoparticle','ShopArticleController');
        //申请的hair
        Route::resource('shapply','ShopApplyHairController');
        //店铺已经选中的hair
        Route::resource('shophair','ShopHairController');
        //店铺已经选中的color
        Route::resource('shopcolor','ShopColorController');
        //店铺的coupon
        Route::resource('shopcoupon','ShopCouponController');
        //MyCoupon
        Route::resource('mycoupon','MyCouponController');
        //user的subscribe
        Route::resource('usubscribe','UserSubscribeController');
        //shop的关注信息
        Route::resource('sfollow','ShopFollowController');
		//引入非resource类的userinfo文件；
        require(__DIR__.'/admin/userinfo.php');
        Route::get('haircolorshow/{hairid}','HairColorController@haircolorshow');
        Route::get('addhaircolor/{hairid}', 'HairColorController@addhaircolor');
        Route::get('article_show/{aid}','ShopController@article_show');
        Route::get('shophair_show/{id}','ShopHairController@shophair_show');
	});
	Route::get('login','LoginController@showLoginForm');
	Route::post('login','LoginController@login');
	Route::post('logout','LoginController@logout');
});


//前台登陆验证

//    Route::group(['middleware' => 'auth.userinfo'], function () {
//        Route::get('/', 'UserInfo\IndexController@index');
//    });

    // Route::get('login', 'UserInfo\LoginController@showLoginForm')->name('userinfo.login');
    // Route::post('login', 'UserInfo\LoginController@login');
    // Route::post('logout', 'UserInfo\LoginController@logout');
